Dismiss the keyboard when the picker opens on android#5
Conversation
thesahindia
left a comment
There was a problem hiding this comment.
Looks good and tests well!
cc: @tgolen
| {...pickerProps} | ||
| onFocus={() => { | ||
| Keyboard.dismiss(); | ||
| if (pickerProps.onFocus) { |
There was a problem hiding this comment.
I'm not sure about how this repo does it, but in E/App we would also check to make sure that onFocus is also a function before calling it. Should we do that here? It seems like it would be nice, so that the lib doesn't crash if someone passes something that isn't a function.
There was a problem hiding this comment.
That was what I initially thought too. But I check for the other callback (onOpen, onClose) and none of them check if it's a function. I think it's fine to let the app that implement the library to make sure a function is passed, just like React Native component that will throw an error if you give onPress an integer.
There was a problem hiding this comment.
OK, I think that works for me. I'll be interested to see if they request something similar in the upstream repo's PR.
Dismiss the soft keyboard when the picker opens on Android. This will align the behavior with the iOS platform.
Related Issue: Expensify/App#15109
Upstream PR: lawnstarter#501